#ifndef __GLOBALS_HEADER__
#define __GLOBALS_HEADER__
//##############################################################################




/** PID parameters for the different controllers */
extern volatile double pid_yaw [3];
extern volatile double pid_attitude [3];
extern volatile double pid_position [3];
//------------------------------------------------------------------------------




/** Quaternion describing the attitude of the quadrocopter */
extern volatile double quaternion [4];
//------------------------------------------------------------------------------




/** Rotation angles as sum of 1D rotations */
extern volatile double rot1D [3];
//------------------------------------------------------------------------------




/** Current orientation (computed from quaternion) */
extern volatile double orientation [3];
//------------------------------------------------------------------------------




/** Current speed */
extern volatile double speed [3];
//------------------------------------------------------------------------------




/** Current position */
extern volatile double position [3];
//------------------------------------------------------------------------------




/** Sensor values */
extern volatile double itg [3];
extern volatile double adxl [3];
//------------------------------------------------------------------------------




/** Reference values */
extern volatile double attitude_reference [2];
extern volatile double yaw_reference;
//------------------------------------------------------------------------------




/** ID values */
extern volatile double pid_attitude_integral [2];
extern volatile double pid_attitude_last [2];
extern volatile double pid_yaw_integral;
extern volatile double pid_yaw_last;
extern volatile double pid_position_integral [3];
extern volatile double pid_position_last [3];
//------------------------------------------------------------------------------




/** Control parameters to enable and disable parts of the system */
extern volatile signed char ctl_engine;
extern volatile signed char ctl_calibration;
extern volatile signed char ctl_quaternion;
extern volatile signed char ctl_attitude;
extern volatile signed char ctl_yaw;
extern volatile signed char ctl_position;
//##############################################################################




void globals_set_default( void );
//##############################################################################




#endif //__GLOBALS_HEADER__

